home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 February / PCWorld_2000-02_cd.bin / Software / Vyzkuste / xsetup / _SETUP.2 / Group3 / XQ WSH 1.xpl < prev    next >
Text File  |  1999-09-16  |  4KB  |  132 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 5.0"
  2. "TYPE"="6"
  3. "COUNT"="1"
  4. "UIPATH"="Program Options\Windows Scripting Host"
  5. "NAME"="WSH Options"
  6. "VERSION"="1.01"
  7. "LANGUAGE"="VBScript"
  8. "TEXT 1"="Display copyright message when running a script"
  9. "DESCRIPTION 1"="Some options for Windows Scripting Host."
  10. "AUTHOR"="Xteq Systems"
  11. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  12. "COMMENT 1"="For more information, go to http://www.xteq.com or write to TeXHeX@xteq.com."
  13. "COMMENT 2"="Thanks to CptSiskoX for the settings and the idea."
  14.  
  15.  
  16. '-- ONLY CHANGE THE LINES WITHOUT ' at the beginning !!
  17. '
  18. '*** Xteq Systems "On/Off" Plug-in Template ***
  19. '*** ID_XQ_PT1 V1.00 
  20.  
  21.  ' how many settings are in this file (change "COUNT=" also!) 
  22.  CountSettings=1
  23.  
  24.  ' does this plug-in requires the user to logoff or to restart his PC?
  25.  bRequireLogoff=0
  26.  bRequireRestart=0 
  27.  
  28.  ' if this path exists in the registry, the plug-in will be enabled. if it does
  29.  ' not exist, the plug-in will be disable set to ="" to ignore this check and alway
  30.  ' enable the plug-in, regardless if the path exists or not
  31.  sCheckPath="HKLM\Software\Microsoft\Windows Scripting Host\"
  32.  
  33.  
  34.  ' Settings for Value # 1
  35.  sV1_Path="HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Scripting Host\Settings\DisplayLogo" 
  36.  sV1_OnValue="1"      'what is the "ON" value (e.g. "1", "True", "On" etc.)
  37.  sV1_OffValue="0"     'what is the "OFF" value (e.g. "0", "False", "Off" etc.)
  38.  sV1_DataType="1"     'datatype of this value (REG_STRING=1, REG_DWORD=2, REG_BINARY=3, REG_EXPAND_SZ=4)
  39.  
  40.  ' Settings for Value # 2
  41.  sV2_Path="HKCU\Software\Hypernix\Gooey\Environment\OpenLinkInNewWindow" 
  42.  sV2_OnValue="1"      
  43.  sV2_OffValue="0"      
  44.  sV2_DataType="2"     
  45.  
  46.  ' Settings for Value # 3
  47.  sV3_Path="HKCU\Software\Hypernix\Gooey\Environment\UseSounds" 
  48.  sV3_OnValue="1"      
  49.  sV3_OffValue="0"      
  50.  sV3_DataType="2"     
  51.  
  52.  ' Settings for Value # 4
  53.  sV4_Path="HKCU\Software\Hypernix\Gooey\Environment\UseAutoCopy" 
  54.  sV4_OnValue="1"      
  55.  sV4_OffValue="0"      
  56.  sV4_DataType="2"     
  57.  
  58.  ' Settings for Value # 5
  59.  sV5_Path="HKCU\Software\Hypernix\Gooey\Network\AllwaysOntop" 
  60.  sV5_OnValue="1"      
  61.  sV5_OffValue="0"      
  62.  sV5_DataType="2"     
  63.  
  64. '*** Xteq Systems "On/Off" Plug-in Template ***
  65. '
  66. '-- STOP CHANGES HERE !!
  67.  
  68.  
  69.  
  70. Sub Plugin_Initialize 
  71.  If Len(sCheckPath)>0 then
  72.     if left(sCheckPath,1)<>"\" then sCheckPath=sCheckPath & "\"
  73.  
  74.     b=RegPathExists(sCheckPath)
  75.     if b=true then
  76.        Call ReadSettings
  77.     else
  78.        Call Disable
  79.     end if  
  80.  else
  81.     Call ReadSettings
  82.  end if
  83. End Sub
  84.  
  85. Sub ReadSettings
  86.                            Call ReadSettingsEx(1,sV1_Path,sV1_OnValue)
  87.   if CountSettings>=2 then Call ReadSettingsEx(2,sV2_Path,sV2_OnValue)
  88.   if CountSettings>=3 then Call ReadSettingsEx(3,sV3_Path,sV3_OnValue)
  89.   if CountSettings>=4 then Call ReadSettingsEx(4,sV4_Path,sV4_OnValue)
  90.   if CountSettings>=5 then Call ReadSettingsEx(5,sV5_Path,sV5_OnValue)
  91. End Sub
  92.  
  93. Sub ReadSettingsEx(ID,REGP,VALON)
  94.  s=RegReadValue(REGP)
  95.  'Call DebugMsg("VAL:" & s & " ID:" & ID & " VAL_ON:" & VALON)
  96.  if CStr(s)=VALON then
  97.     Call SetUIElement(ID,true)
  98.  End if 
  99. End Sub
  100.  
  101.  
  102. Sub Plugin_CheckData(ElementIndex)
  103. End Sub
  104.  
  105.  
  106. Sub Plugin_Apply(ElementIndex,ElementSubIndex)
  107.                           Call WriteSettings(GetUIElement(1),sV1_Path,sV1_OnValue,sV1_OffValue,sV1_DataType)
  108.  if CountSettings>=2 then Call WriteSettings(GetUIElement(2),sV2_Path,sV2_OnValue,sV2_OffValue,sV2_DataType)
  109.  if CountSettings>=3 then Call WriteSettings(GetUIElement(3),sV3_Path,sV3_OnValue,sV3_OffValue,sV3_DataType)
  110.  if CountSettings>=4 then Call WriteSettings(GetUIElement(4),sV4_Path,sV4_OnValue,sV4_OffValue,sV4_DataType)
  111.  if CountSettings>=5 then Call WriteSettings(GetUIElement(5),sV5_Path,sV5_OnValue,sV5_OffValue,sV5_DataType)
  112.  
  113.  
  114.  if bRequireLogoff then Logoff()
  115.  if bRequireRestart then Restart()
  116. End Sub
  117.  
  118. Sub WriteSettings(CUR_VAL,REGP,ON_VAL,OFF_VAL,DAT_TYPE)
  119.   if CUR_VAL=true then
  120.      Call RegWriteValue(REGP,ON_VAL,DAT_TYPE)
  121.   else
  122.      Call RegWriteValue(REGP,OFF_VAL,DAT_TYPE)
  123.   end if
  124. End Sub
  125.  
  126.  
  127. Sub Plugin_Terminate 
  128. End Sub
  129.  
  130.  
  131.  
  132.